﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.OracleClient;

namespace Userinterface_Ver._1_
{
    public partial class frmAddUser : DevComponents.DotNetBar.Office2007Form
    {
        public frmAddUser()
        {
            InitializeComponent();
        }

        private void frmAddRole_Load(object sender, EventArgs e)
        {

        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            //clsConnectDatabase.con.Open();
            try
            {
                string sql = "insert into USERS values('" + txtTenDangNhap.Text + "','" + txtPassword.Text + "','" + cobRole.Text + "','" + txtDescription.Text + "','')";
                OracleCommand com = new OracleCommand(sql, clsConnectDatabase.con);
                com.ExecuteNonQuery();
                MessageBox.Show("Thêm người dùng thành công !");
            }
            catch (Exception)
            {
                MessageBox.Show("Thêm mới người dùng không thành công");
            }
        }

        private void btnRedo_Click(object sender, EventArgs e)
        {
            txtTenDangNhap.Text = "";
            txtPassword.Text = "";
            txtDescription.Text = "";
            txtConfirm.Text = "";
            cobRole.Text = "";
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            Close();
        }
    }
}
